#pragma once
#include <vector>
#include "vulkan/vulkan.h"
#include <iostream>
#include <string>
#include "SDL/SDL.h"
#include "SDL/SDL_vulkan.h"
static VKAPI_ATTR VkBool32 VKAPI_CALL DebugCallback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageType,
	const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, void* pUserData)
{
	std::string type;
	if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT)
		type = "[VERBOSE]";
	else if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT)
		type = "[INFO]";
	else if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT)
		type = "[WARNING]";
	else if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT)
		type = "[ERROR]";
	SDL_Log("Validation Layer%s:%s", type.c_str(), pCallbackData->pMessage);
	return VK_FALSE;
}

class VKValidLayersAndExts
{
public:
	bool CheckValidationLayerSupport();

	VkResult CreateDebugUtilsMessengerEXT(VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugUtilsMessengerEXT* pCallback);
	void DestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT callback, VkAllocationCallbacks* pAllocator);

	void SetupDebugCallback(VkInstance instance, bool isValidationLayersEnable);
	void DestroyDebugCallback(VkInstance instance, bool isValidationLayersEnable);
	std::vector<const char*> GetSDLRequiredExtensions(bool isValidationLayersEnable);

	const std::vector<const char*> m_RequiredValidationLayers =
	{
		"VK_LAYER_LUNARG_standard_validation"
	};

private:
	VkDebugUtilsMessengerEXT m_Callback;

	
};

